package com.softWang.job.test.task;

import com.fasterxml.jackson.databind.ObjectMapper;

import com.softWang.job.po.JobManage;
import com.softWang.job.test.task.Service.TaskDemo1Service;
import com.softWang.job.test.task.domain.vo.User;
import com.softWang.job.util.AbstractQuartzJob;
import org.quartz.JobExecutionContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 定时任务调度测试
 * 
 * @author ruoyi
 */
@Component
public class RyTask3 extends AbstractQuartzJob
{
    @Autowired
    private TaskDemo1Service demo1Service;
    @Autowired
    private ObjectMapper objectMapper;

    @Override
    protected void doExecute(JobExecutionContext context, JobManage sysJob) throws Exception {
        String params = sysJob.getParameter();
        User user = objectMapper.readValue(params, User.class);
        demo1Service.test3(user);
    }
}
